package com.camtc.camcenter.controller.system;

import com.camtc.camcenter.base.bean.BaseQueryBean;
import com.camtc.camcenter.base.controller.BaseController;
import com.camtc.camcenter.base.service.BaseService;
import com.camtc.camcenter.controller.system.bean.UserQueryBean;
import com.camtc.camcenter.custom.CamHttpResult;
import com.camtc.camcenter.dao.entity.CloudUser;
import com.camtc.camcenter.service.CloudUserService;
import io.swagger.annotations.*;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import static com.camtc.camcenter.base.controller.BaseController.API_PATH;
import static com.camtc.camcenter.controller.system.UserController.CONTROLLER_NAME;

/**
 * <p>
 *
 * </p>
 *
 * @author chentianshun
 * @since 2021-07-20
 */

@Api(value = "用户请求处理")
@Slf4j
@RestController
@RequestMapping(API_PATH + CONTROLLER_NAME)
public class UserController extends BaseController<CloudUser, UserQueryBean> {

    private CloudUserService cloudUserService;

    public static final String CONTROLLER_NAME = "userController/";

    @Autowired
    public void setCloudUserService(CloudUserService cloudUserService) {
        this.cloudUserService = cloudUserService;
    }

    @Override
    public BaseService<CloudUser> initBaseService() {
        return cloudUserService;
    }

    @GetMapping("pageList")
    public CamHttpResult query(UserQueryBean queryBean) {
        return queryPage(queryBean);
    }
}
